<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>index</title>
</head>
<body>
<h1>UpdateTest page</h1>

<label for="f1">选择上传文件</label>
<input type="file" id="f1">
<button id="ud">确认上传</button>

</body>
<script src="/static/js/jquery-3.4.1.min.js"></script>
<script src="/static/js/ajax_setup.js"></script>
<script>
    $("#ud").click(function () {
        var formdata = new FormData();
        formdata.append('f1', $('#f1')[0].files[0]);
        $.ajax({
            url: '/upload/',
            type: 'post',
            data: formdata,
            processData: false,
            contentType: false,
            success: function (data) {
                alert(data)
            }
        })
    })
</script>
</html>